<?php 
	/**
	 * PUBLIC_RESOURCE = $this->baseUrl();
	 */
	$this->headTitle(" Hmobile ");
	
	//Add css file
	$this->headLink()
	->appendStylesheet(PUBLIC_RESOURCE.'/skins/default/css/default.css')
	->appendStylesheet(PUBLIC_RESOURCE.'/skins/default/css/style.css')					//style admin page
	->appendStylesheet(PUBLIC_RESOURCE.'/skins/default/js/jquery-ui/css/ui-lightness/jquery-ui-1.10.3.custom.css')
	//->offsetSetStylesheet(1,PUBLIC_RESOURCE.'/skins/default/js/jquery-ui/css/ui-lightness/jquery-ui-1.10.3.custom.css')//jquery ui
	;
	
	//Add js file
	$this->headScript()->prependFile(PUBLIC_RESOURCE.'/skins/default/js/jquery-2.0.3.min.js')			// jquery
	->appendFile(PUBLIC_RESOURCE.'/skins/default/js/jssor-slider/js/jssor.core.js')
	->appendFile(PUBLIC_RESOURCE.'/skins/default/js/jssor-slider/js/jssor.utils.js')
	->appendFile(PUBLIC_RESOURCE.'/skins/default/js/jssor-slider/js/jssor.slider.js')
	->appendFile(PUBLIC_RESOURCE.'/skins/default/js/tabs_nav.js')
	->appendFile(PUBLIC_RESOURCE.'/skins/default/js/jquery-ui/js/jquery-ui-1.10.3.custom.js')	// jquery ui
	->appendFile(PUBLIC_RESOURCE.'/skins/default/js/default.js')	// gio hang
	;
// 	$header = $this->action('header', 'layout','default');
// 	$footer = $this->action('footer', 'layout','default');
// 	$sidebar = $this->action('sidebar','layout','default');
// 	$navigation = $this->action('navigation','layout','default');
// 	$slider = $this->action('slider','layout','default');
// 	$search = $this->action('search','layout','default');

	$defaultPlaceholders = array(
			'header'=>array(
					'status'=>true,
					'content'>""							
			),
			'sidebar'=>array(
					'status'=>true,
					'content'>""	
			),
			'navigation'=>array(
					'status'=>true,
					'content'>""	
			),
			'slider'=>array(
					'status'=>true,
					'content'>""	
			),
			'search'=>array(
					'status'=>true,
					'content'>""	
			),
			'footer'=>array(
					'status'=>true,
					'content'>""	
			)
	);
	$defaultPlaceholders = array_replace_recursive(
			$defaultPlaceholders, (array)$this->layout()->placeholders
	);
	
	foreach($defaultPlaceholders as $key => $value){
		if($value['status']==true){
				$defaultPlaceholders[$key]['content'] = $this->action($key, 'layout','default');
		}
	}
	$header = $defaultPlaceholders['header']['content'];
	$footer = $defaultPlaceholders['footer']['content'];
	$search = $defaultPlaceholders['search']['content'];
	$sidebar = $defaultPlaceholders['sidebar']['content'];
	$slider = $defaultPlaceholders['slider']['content'];
	$navigation = $defaultPlaceholders['navigation']['content'];
	//extract($defaultPlaceholders);
	$content = $this->layout()->content;
?>
<!DOCTYPE HTML>
<html>   
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="icon"  type="image/png" 
      	href="">
       <?php echo $this->headTitle()?>
       <?php echo $this->headLink()?>
       <?php echo $this->headScript()?>
       <?php echo $this->headMeta();?>
       
    </head>
    <body>
		<!-- Facebook plugin -->
		<div id="fb-root"></div>
		<script>(function(d, s, id) {
		  var js, fjs = d.getElementsByTagName(s)[0];
		  if (d.getElementById(id)) return;
		  js = d.createElement(s); js.id = id;
		  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
		  fjs.parentNode.insertBefore(js, fjs);
		}(document, 'script', 'facebook-jssdk'));</script>
		
		<!-- end facebook plugin -->
		
    	<!-- Header -->
    		<?php echo $header;?>
    	<!-- End header -->
    	
    	<!-- Wrapper section -->
    	<div id="wrapper-section">
    		<!-- Navigation -->
    			<?php echo $navigation;?>
    		<!-- End navigation -->
    		
    		<!-- wrapper include ( sidebar and content and search box) -->
    		<div class="wrapper">
    			<!-- Slider -->
    				<?php echo $slider;?>
    			<!-- End slider -->
    			
    			<!-- Search -->
    				<?php echo $search;?>
    			<!-- End search -->
    			
    			<!-- main-contain -->
				<div id="main-contain" class="clearfix">
	    		
	    			<!-- Content -->
	    				<!-- left -->
						<div id="left-wrap">
							<div id="left-column">
	    						<?php echo $content;?>
	    					</div>
							<!-- End left column -->
						</div>
						<!-- End div wrap -->
	    			<!-- End content -->
	    			
	    			<!-- Sidebar -->
	    				<?php echo $sidebar;?>
	    			<!-- End sidebar -->
	    		</div>
	    		<!-- End main contain -->
	    	</div>	
    		<!-- End wrapper -->
    	</div>
    		
    	<!-- Footer -->
    		<?php echo $footer?>
    	<!-- End footer -->
		<div id='label-receive-mail'>
			<a href='#'>Đăng ký nhận mail tin tức</a>
		</div>
		<div id='form-receive-mail'>
			<span>&nbsp;</span>
			<form class='clearfix' method='post'>
				<p>
				<label>Email:</label>
				<input type='text' name='email' value='' id='email'/>
				<input type='submit' name='submit-receive-mail' value='Đăng ký' class='button' />
				</p>	
			</form>
		</div>
		<script>
			$(document).ready(function(){
				$("#form-receive-mail").hide();
				$("#label-receive-mail").on('click',function(){
					$(this).slideUp('slow',function(){
						$("#form-receive-mail").slideDown('slow');
					});
					
				});
				$("#form-receive-mail span").on('click',function(){
					$("#form-receive-mail").slideUp('slow',function(){
						$("#label-receive-mail").slideDown('slow');
					})
				});

				$('#form-receive-mail form').submit(function(event){
					var email = $('#form-receive-mail form #email').val();
					$.ajax({
						type:'post',
						url:'/default/user/receiveemail/',
						data:{'email':email},
						success:function(data){
							alert(data);
							$("#form-receive-mail").fadeOut('slow',function(){
								$("#label-receive-mail").show('slow');
							})
						}
						
					});
					
					event.preventDefault();
					return false;
				});
			});
		</script>
    </body>
</html>    
    
    
    
    